Downgrade term crate back down to 0.2 (from 0.4).
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Sat, 30 Jan 2016 13:57:15 +0000 (14:57 +0100)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Sat, 30 Jan 2016 13:57:15 +0000 (14:57 +0100)
This is undoing part of commit dd34296

Fix #2338

(Unfortunately I do not have a suggestion for how to make a unit test
for this problem; doing so would require putting in a bit more effort
than I have time for at the moment.)

Cargo.lock
Cargo.toml
src/cargo/core/shell.rs
src/cargo/util/errors.rs

index a2d750066d9dd87b60df38c78b07c74b27ed941c..ee26f7e1ff42265e2dd56ffbb59ee464ea5a8cf8 100644 (file)
@@ -25,7 +25,7 @@ dependencies = [
  "semver 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "tar 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "tempdir 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "term 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
  "toml 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -395,7 +395,7 @@ dependencies = [
 
 [[package]]
 name = "term"
-version = "0.4.0"
+version = "0.2.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
index ed3e7cb8e973e9de29b0a1f452bb3c6b3a8f74fb..5e3c52d590b3c802ac3175d46c8a4f5e5b603fd7 100644 (file)
@@ -37,7 +37,7 @@ regex = "0.1"
 rustc-serialize = "0.3"
 semver = "0.2.0"
 tar = "0.4"
-term = "0.4"
+term = "0.2"
 time = "0.1"
 toml = "0.1"
 url = "0.2"
index 14cc5f38794d44b6e83dfdc078224ebc8e835723..cc764dcb664827505aa81e04a95e4fd2fdc751d4 100644 (file)
@@ -3,7 +3,7 @@ use std::io::prelude::*;
 use std::io;
 
 use term::color::{Color, BLACK, RED, GREEN, YELLOW};
-use term::{self, Terminal, TerminfoTerminal, color, Attr};
+use term::{Terminal, TerminfoTerminal, color, Attr};
 
 use self::AdequateTerminal::{NoColor, Colored};
 use self::Verbosity::{Verbose, Normal, Quiet};
@@ -193,24 +193,22 @@ impl Shell {
         Ok(())
     }
 
-    fn fg(&mut self, color: color::Color) -> CargoResult<bool> {
+    fn fg(&mut self, color: color::Color) -> io::Result<bool> {
         let colored = self.colored();
 
         match self.terminal {
-            Colored(ref mut c) if colored => try!(c.fg(color)),
-            _ => return Ok(false),
+            Colored(ref mut c) if colored => c.fg(color),
+            _ => Ok(false),
         }
-        Ok(true)
     }
 
-    fn attr(&mut self, attr: Attr) -> CargoResult<bool> {
+    fn attr(&mut self, attr: Attr) -> io::Result<bool> {
         let colored = self.colored();
 
         match self.terminal {
-            Colored(ref mut c) if colored => try!(c.attr(attr)),
-            _ => return Ok(false)
+            Colored(ref mut c) if colored => c.attr(attr),
+            _ => Ok(false)
         }
-        Ok(true)
     }
 
     fn supports_attr(&self, attr: Attr) -> bool {
@@ -222,14 +220,13 @@ impl Shell {
         }
     }
 
-    fn reset(&mut self) -> term::Result<()> {
+    fn reset(&mut self) -> io::Result<()> {
         let colored = self.colored();
 
         match self.terminal {
-            Colored(ref mut c) if colored => try!(c.reset()),
-            _ => ()
+            Colored(ref mut c) if colored => c.reset().map(|_| ()),
+            _ => Ok(())
         }
-        Ok(())
     }
 
     fn colored(&self) -> bool {
index 54934e10baa099f14c7f4281bfe045c5d23653ad..e2ba109f3b20a6b17ec42825b3bbe3e7a97ed2ad 100644 (file)
@@ -9,7 +9,6 @@ use curl;
 use git2;
 use rustc_serialize::json;
 use semver;
-use term;
 use toml;
 use url;
 
@@ -307,7 +306,6 @@ from_error! {
     url::ParseError,
     toml::DecodeError,
     ffi::NulError,
-    term::Error,
 }
 
 impl<E: CargoError> From<Human<E>> for Box<CargoError> {
@@ -327,7 +325,6 @@ impl CargoError for toml::Error {}
 impl CargoError for toml::DecodeError {}
 impl CargoError for url::ParseError {}
 impl CargoError for ffi::NulError {}
-impl CargoError for term::Error {}
 
 // =============================================================================
 // Construction helpers